package cemp.controller;


import cemp.common.api.reponse.RestCommonResponse;
import cemp.common.api.reponse.RestStockAllResponse;
import cemp.common.api.reponse.RestStockResult;
import cemp.service.KpiService;
import cemp.service.StockCoreService;
import com.fetchdata.api.FetchDataApi;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@AllArgsConstructor
@RequestMapping("/kpi")
public class KpiDataController {

    private final KpiService kpiService;
    private final FetchDataApi fetchDataApi;

    @GetMapping("/decrease3")
    public List<String> decrease3(
            @RequestParam(value = "staDate",required = true) String staDate,
            @RequestParam(value = "inteval",required = true) Integer inteval
    ) {

        return kpiService.getDecrease3(staDate,inteval);
    }

    @GetMapping("/avg/smooth")
    public List<String> avgSmooth(
            @RequestParam(value = "staDate",required = true) String staDate,
            @RequestParam(value = "inteval",required = true) Integer inteval
    ) {

        return kpiService.avgSmooth(staDate,inteval);
    }




}
